﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BattleMaster_IRCbot.UserCommands
{
    class Logout : Command
    {
        public override string Name { get { return _name; } }
        public override string[] Aliasses { get { return _aliasses; } }
        public override string Description { get { return _description; } }
        public override string ShortDesc { get { return _shortDesc; } }

        public Logout()
        {
            _name = "Logout";
            _aliasses = new string[] { "log" };
            _description = "Use this command to log out of your character.\n Once you have done so, your character will be removed from the active list and other characters will no longer be able to interact with it.";
            _shortDesc = "Use this command to log out of your character.";
        }

        public override void Verb(Game game, string msgOrigen, string[] cmd)
        {
            if (msgOrigen != "console")
            {
                if (game.isLoggedIn(msgOrigen))
                {
                    game.removeCharacter(msgOrigen);
                    game.ircHandler.sendNotice(msgOrigen, "You are now logged out.");
                }
                else game.ircHandler.sendNotice(msgOrigen, "You can't log out if you are not logged in.");
            }
        }
    }
}

